const state = {
  addPosition: {},
  orderIndex: null,
  firstCreateOrder: true,
  selectFromTo: {}, // 已选择得出发地 和 目的地
  selectedLocation: null, // 已选择的位置信息
  selectedSearch: null, // 已选择的搜索数据
  selectMapResult: null, // 地图插件返回结果参数
  chooseVehicleInfo: null, // 选择的车辆信息
  chooseDriverInfo: null, // 选择的车辆信息
  busChooseVehicleInfo:null,//顺风车选择的车辆信息
  editOrderSave: null, // 编辑订单数据缓存
  distributionDrive:null
}

const mutations = {
  setDistributionDrive: (state, data) => {
  	state.distributionDrive = data
  },
  setAddPosition: (state, data) => {
    state.addPosition = data
  },
  setSelectedLocation: (state, data) => {
    state.selectedLocation = data
  },
  setSelectedSearch: (state, data) => {
    state.selectedSearch = data
  },
  setSelectMapResult: (state, data) => {
    state.selectMapResult = data
  },
  setSelectedFromTo: (state, data) => {
    state.selectFromTo = {
		...state.selectFromTo,
		...data
	}
  },
  setChooseVehicleInfo: (state, data) => {
    state.chooseVehicleInfo = data
  },
  setBusChooseVehicleInfo: (state, data) => {
    state.busChooseVehicleInfo = data
  },
  setChooseDriverInfo: (state, data) => {
    state.chooseDriverInfo = data
  },
  setOrderIndex: (state, data) => {
    state.orderIndex = data
  },
  setFirstCreateOrder: (state, data) => {
    state.firstCreateOrder = data
  },
  setEditOrderSave: (state, data) => {
    state.editOrderSave = data
  }
}

const actions = {

}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
